/**
 * Created by python on 18-12-8.
 */

const HOST = 'http://127.0.0.1:8000/';



Vue.filter('str2date', function (value) {
    return new Date(value);
 })
Vue.filter('date2ymd', function (value) {
    return value.getFullYear() + "-" + (value.getMonth() + 1) + "-" + value.getDate();
 })

Vue.filter('date2hm', function (value) {
    return value.getHours() + ":" + value.getMinutes();
 })

const WEEK = ['周日','周六','周五','周四','周三','周二','周一']
Vue.filter('date2w', function (value) {
    return WEEK[value.getDay()]
 })


function get_query_string(name, default_value) {
    var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
    var r = window.location.search.substr(1).match(reg);
    if (r != null) {
        return decodeURI(r[2]);
    }
    return default_value;
}
